package com.jiang.Aop;

import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

/**
 * @author jiangjingbo
 * @version V1.0
 * @Project java2203
 * @Package com.jiang.Aop
 * @Description:
 * @Date 2022/6/7 11:31
 */

@Aspect
@Component//将Aoptest1
public class Aoptest1 {

    @Pointcut("execution(* com.jiang.service.Userserviceimpl1.*(..))")
    public void pc(){ }

    /**
     * 后置
     */
    @After("pc()")
    public void  myAfter() {
        System.out.println("======执行了after后置通知====相当于执行方法后提交事务============");
    }


    @Before("pc()")
    public void myBefore(){
        System.out.println("======执行了Before前置置通知====相当于执行方法后提交事务============");
    }
}
